package com.hust360.percent.pojo;

import java.util.ArrayList;
import java.util.List;

import com.hust360.percent.PercentApplication;

import android.database.Cursor;

public class UserLocal extends User {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2865435315643721894L;

	@Override
	public List<Dsc_usr> getDsc_usrs() {
		List<Dsc_usr> list = null;
		Dsc_usr dsc_usr = null;
		Cursor c = PercentApplication.localDB.rawQuery("SELECT * FROM dsc_usr WHERE uid='" + id +"'", null);
		list = new ArrayList<Dsc_usr>(c.getCount());
		while (c.moveToNext()) {
			dsc_usr = new Dsc_usr();
			dsc_usr.dscid = c.getLong(c.getColumnIndex(Dsc_usr.DSCID));
			dsc_usr.id = c.getLong(c.getColumnIndex(Dsc_usr.ID));
			dsc_usr.uid = c.getLong(c.getColumnIndex(Dsc_usr.UID));
			list.add(dsc_usr);
		}
		c.close();
		return list;
	}

}
